/**
 *******************************************************************************
 * @file  tca9539.c
 * @brief This file provides firmware functions for IO expand IC TCA9539.
 @verbatim
   Change Logs:
   Date             Author          Notes
   2020-06-12       Zhangxl         First version
 @endverbatim
 *******************************************************************************
 * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved.
 *
 * This software component is licensed by HDSC under BSD 3-Clause license
 * (the "License"); You may not use this file except in compliance with the
 * License. You may obtain a copy of the License at:
 *                    opensource.org/licenses/BSD-3-Clause
 *
 *******************************************************************************
 */

/*******************************************************************************
 * Include files
 ******************************************************************************/
#include "tca9539.h"

/**
 * @addtogroup BSP
 * @{
 */

/**
 * @addtogroup Components
 * @{
 */

/** @defgroup TCA9539 IO Expand IC TCA9539
  * @{
  */

#if (BSP_TCA9539_ENABLE == BSP_ON)

/*******************************************************************************
 * Local type definitions ('typedef')
 ******************************************************************************/

/*******************************************************************************
 * Local pre-processor symbols/macros ('#define')
 ******************************************************************************/

/*******************************************************************************
 * Global variable definitions (declared in header file with 'extern')
 ******************************************************************************/

/*******************************************************************************
 * Local function prototypes ('static')
 ******************************************************************************/

/*******************************************************************************
 * Local variable definitions ('static')
 ******************************************************************************/

/*******************************************************************************
 * Function implementation - global ('extern') and local ('static')
 ******************************************************************************/
/**
 * @defgroup TCA9539_Global_Functions TCA9539 Global Functions
 * @{
 */
/**
 * @brief  Initialize IO expand IC TCA9539.
 * @param  None
 * @retval None
 */
void TCA9539_Init(void)
{
    EIO_Init();
}

/**
 * @brief  Reset IO expand IC TCA9539.
 * @param  None
 * @retval None
 */
void TCA9539_Reset(void)
{
    EIO_Reset();
}

/**
 * @brief  Initialize IO expand IC TCA9539 interrupt.
 * @param  None
 * @retval None
 */
void TCA9539_IntInit(void)
{
    EIO_IntInit();
}

/**
 * @brief  Reset IO expand IC TCA9539.
 * @param  [in] u8Reg TCA9539 register.
 *   @arg  TCA9539_REG_INPUT_0
 *   @arg  TCA9539_REG_INPUT_1
 *   @arg  TCA9539_REG_OUTPUT_0
 *   @arg  TCA9539_REG_OUTPUT_1
 *   @arg  TCA9539_REG_INVERT_0
 *   @arg  TCA9539_REG_INVERT_1
 *   @arg  TCA9539_REG_CONFIG_0
 *   @arg  TCA9539_REG_CONFIG_1
 * @param  [in] u8Val The value to written.
 * @retval None
 */
void TCA9539_WriteReg(uint8_t u8Reg, uint8_t u8Val)
{
    EIO_Write(u8Reg, u8Val);
}

/**
 * @brief  Reset IO expand IC TCA9539.
 * @param  [in] u8Reg TCA9539 register.
 *   @arg  TCA9539_REG_INPUT_0
 *   @arg  TCA9539_REG_INPUT_1
 *   @arg  TCA9539_REG_OUTPUT_0
 *   @arg  TCA9539_REG_OUTPUT_1
 *   @arg  TCA9539_REG_INVERT_0
 *   @arg  TCA9539_REG_INVERT_1
 *   @arg  TCA9539_REG_CONFIG_0
 *   @arg  TCA9539_REG_CONFIG_1
 * @param  [out] *u8Val TCA9539 register value to read.
 * @retval None
 */
void TCA9539_ReadReg(uint8_t u8Reg, uint8_t *u8Val)
{
    EIO_Read(u8Reg, u8Val);
}
/**
 * @}
 */

#endif /* BSP_TCA9539_ENABLE */

/**
 * @}
 */

/**
 * @}
 */


/**
* @}
*/

/******************************************************************************
 * EOF (not truncated)
 *****************************************************************************/
